/*
 * Article display widget of Lukija RiL client.
 *
 * @author Yves Marcoz
 *
 * Copyright(C) 2011 Yves Marcoz <yvez@marcoz.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import Qt 4.7
import QtWebKit 1.0

Rectangle {
    width: parent.width;
    height: parent.height
    color: "white";

    signal panningStarted;
    signal panningEnded;

    Flickable {
        id: flickable
        height: parent.height;
        width: parent.width;
        contentWidth: webView.width * webView.scale;
        contentHeight: Math.max(articleViewer.height,webView.height*webView.scale)
        flickDeceleration: 1500;

        onMovementStarted: {
            panningStarted();
        }

        onMovementEnded: {
            panningEnded();
        }

        WebView {
            id: webView
            html:  flipItem.html
            preferredWidth: flickable.width
            preferredHeight: flickable.height
            transformOrigin: Item.TopLeft
            settings.defaultFontSize: 24
        }
    }
}
